"""
cutils.py

Python wrapper around _cutils, principally for type checking
"""

import _cutils

def randmatrix(n, c, seed=None):
    """
    Returns a NumPy array that represent a cuadratic matrix
    of nxn elements. The elements in the matrix take the value
    one with a probability of c. Use a seed if you want to obtain
    reproducible results. 

    Arguments:
    n       -- number of cells (integer)
    c       -- probability of having a one
    seed    -- random seed
    """
    # Type checking
    if type(n) is not int:
        # insert error msg here
        return 0
    
    if c<0 or c>1:
        # insert error msg here
        return 0
        
    if seed is None:
        return _cutils.randmatrix(n, c, 0)
    else:
        return _cutils.randmatrix(n, c, seed)


